<% layout('layout/appLayout') %>
<% block('header').append(`<style>
.index_goods_wrap {
  overflow: hidden;

  padding:10px 3px;
}
.index_goods_list {
  list-style: none;
  margin:0;
  padding:0;
}
.index_goods_list li.item {
  float:left;
  width:25%;
  text-align:center;
  height:55px;
  line-height:55px;
  position:relative;
  margin-bottom:5px;
}
.index_goods_list li.item > a {
  margin: 3px;
  display:block;
  color: #FFF;
  background:#f4f4f4;
}
/*.index_goods_list li.item:after{*/
    /*content: "";*/
    /*position: absolute;*/
    /*width: 100%;*/
    /*left: 0;*/
    /*top: 0;*/
    /*height: 100%;*/
    /*border-right: 1px solid #e3e3e3;*/
    /*border-bottom: 1px solid #e3e3e3;*/
/*}*/
.product_list_wrap {
  padding:10px 5px 0;
}
.product_list_wrap  .product_list {
  list-style: none;
  margin:0;
  padding:0;

}
.product_list .pro_item {
   float:left;
   padding:5px;
   width:50%;

}
</style>`) %>
<div class="page has_tab" >
  <div class="light-bg">
    <div class="swiper-container" data-space-between='10' data-pagination='.swiper-pagination' data-autoplay="1000">
      <div class="swiper-wrapper">
        <% homeBanner.forEach(function(item,index){ %>
        <div class="swiper-slide"><img src="<%=item.value %>" alt=""></div>
        <% }) %>
      </div>
    </div>
    <!--<div class="fs13"></div>-->
  </div>

  <div class="index_goods_wrap margin-top light-bg">
    <ul class="index_goods_list clearfix ">
      <% goodTypes.forEach(function(item) { %>
      <li class="item" >
        <a class="lazy"  data-original="<%=item.imgUrl %>"  style="background:#f0f0f0 no-repeat center;background-size:cover;" href="/app/type?catalog=<%=item.name %>" >
           <div style="background:rgba(16, 16, 16, 0.50);"><%=item.nameCn %></div>
        </a>
      </li>
      <% }) %>
    </ul>
  </div>
  <% if(frontInfo.notice && frontInfo.notice.isValid ===1) { %>
  <div class="light-bg fs14 padding margin-top alert alert-warning alert-dismissible" style="  background-color: #fcf8e3;border-color: #faebcc;color: #8a6d3b;" role="alert">
    <%= frontInfo.notice && frontInfo.notice.value %>
  </div>
  <% } %>
  <div class="product_list_wrap light-bg margin-top">
    <h3 class="title main-color text-center padding-bottom5">产品展示</h3>
    <ul class="product_list clearfix">
      <% goods.forEach(function(item){  %>
      <li class="pro_item">
        <a href="/app/goods/detail/<%=item._id %>">
          <div class="pro_img lazy"  data-original="<%=item.imgTmb %>"  style="padding-top:100%;background-size:cover;">
          </div>
          <div class="pro_name">
            <p class="fs14" style="height: 42px;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;"><%=item.name%></p>
            <p class="text-danger">￥<%=item.sellPrice %>
              <% if (!item.stock) { %>
                <span class="text-muted" disabled>[已售罄]</span>
              <% }%>
            </p>
          </div>
        </a>
      </li>
      <%})%>
      <!--<li class="pro_item">-->
        <!--<div class="pro_img" style="padding-top:100%;background:url('http://www.bssfood.com/upload/20180426/iaIYLL-Ztd7JvyfzSfvMAUfY_$date20180426_$600x680_$sma_330x374.jpg');background-size:cover;">-->
        <!--</div>-->
        <!--<div class="pro_name">-->
          <!--<p class="fs14">土鸡</p>-->
          <!--<p class="text-danger">￥20.0</p>-->
        <!--</div>-->
      <!--</li>-->
      <!--<li class="pro_item">-->
        <!--<div class="pro_img" style="padding-top:100%;background:url('http://www.bssfood.com/upload/20180426/iaIYLL-Ztd7JvyfzSfvMAUfY_$date20180426_$600x680_$sma_330x374.jpg');background-size:cover;">-->
        <!--</div>-->
        <!--<div class="pro_name">-->
          <!--<p>土鸡</p>-->
          <!--<p>￥20.0</p>-->
        <!--</div>-->
      <!--</li>-->
    </ul>
  </div>
  <div class="weui-panel weui-panel_access">
    <div class="weui-panel__bd">
      <a href="/app/page/company" class="weui-media-box weui-media-box_appmsg">
        <div class="weui-media-box__hd">
          <img class="weui-media-box__thumb" src="<%=homeBlockImgs[0].value %>" alt="">
        </div>
        <div class="weui-media-box__bd">
          <h4 class="weui-media-box__title"><%=webInfo.webName.value %></h4>
          <p class="weui-media-box__desc" style="-webkit-line-clamp: 5;"><%- homeCompany.split("\n").join("<br />") %></p>
        </div>
      </a>
    </div>
  </div>
  <div class="weui-footer margin-top15">
    <!--<p class="weui-footer__links">-->
      <!--<a href="javascript:void(0);" class="weui-footer__link">公司简介</a>-->
      <!--<a href="javascript:void(0);" class="weui-footer__link">底部链接</a>-->
    <!--</p>-->
    <p class="weui-footer__text"><%=webInfo.copyright.value %></p>
    <p class="weui-footer__text"><%=webInfo.record.value %></p>
  </div>
</div>
<% block('footer').append(`<script src='/js/jquery.lazyload.min.js'></script>`)%>
<% block('footer').append(`<script src='/app/js/swiper.js'></script>`)%>
<% block('footer').append(`<script>
jQuery(function(){
    $("div.lazy,a.lazy").lazyload({effect: "fadeIn"});
    $(".swiper-container").swiper({})
})
</script>`)%>
